<template>
    <div class="app-container">
        <!-- 补贴单信息 -->
        <h5 class="titleInfo">
            补贴单信息
        </h5>
        <el-form ref="list" :inline="true" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="补贴单号">
                        <span v-if="list.data" class="spanToInput">{{list.data.applySn | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="流水单号">
                        <span class="spanToInput">{{list.orderSn | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="预约单号">
                        <span class="spanToInput">{{list.projectOrderSn | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="预约医院">
                        <span v-if="list.data" class="spanToInput">{{list.data.hospitalName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="预约项目">
                        <span v-if="list.data" class="spanToInput">{{list.data.projectName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="创建日期">
                        <span v-if="list.data" class="spanToInput">{{list.data.createdAtStr | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="流水时间">
                        <span v-if="list.data" class="spanToInput">{{list.data.projectOrder.createdAtStr | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="单数">
                        <span class="spanToInput">{{list.count | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 人员信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            人员信息
        </h5>
        <el-form ref="list" :inline="true" :model="list" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="客户姓名">
                        <span v-if="list.data" class="spanToInput">{{list.data.user.realname | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="客户手机号">
                        <span v-if="list.data" class="spanToInput">{{list.data.user.username | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="推荐人姓名">
                        <span v-if="list.data" class="spanToInput">{{list.data.server.realname | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="推荐人手机号">
                        <span v-if="list.data" class="spanToInput">{{list.data.server.username | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="管家姓名">
                        <span v-if="list.data" class="spanToInput">{{list.data.butler.realname | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="管家手机号">
                        <span v-if="list.data" class="spanToInput">{{list.data.butler.username | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="用户角色">
                        <span v-if="list.data" class="spanToInput">{{list.data.role.roleName | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 补贴信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            补贴信息
            <el-button style="margin-left:30px" @click="dialogResults=true" size="mini" type="primary">每月业绩</el-button>
        </h5>
        <!-- 每月业绩弹窗 -->
        <el-dialog title="每月业绩" :visible.sync="dialogResults" width="468px">
            <template>
                <el-table
                    :data="tableData"
                    border
                    style="width:432px"
                    >
                    <el-table-column
                    prop="ym"
                    label="日期"
                    width="216">
                    </el-table-column>
                    <el-table-column
                    prop="achive"
                    label="姓名">
                    </el-table-column>
                </el-table>
            </template>
        </el-dialog>
        <el-form ref="list" :inline="true" :model="list" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="扣除杂费">
                        <span v-if="list.data" class="spanToInput">{{list.data.projectOrder.allPrice | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="奖励金额">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="现金补贴">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="补贴金额">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="杂费金额">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="共补贴期数">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="现金补贴">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="期数/次">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="积分补贴">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="期数/次">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="首次补贴">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
        <!-- 图片信息 -->
        <div class="divBar"></div>
        <h5 class="titleInfo">
            图片信息
        </h5>
        <el-form ref="list" :inline="true" :model="list" label-width="130px">
            <el-row>
                <el-col :span="12">
                    <el-form-item label="消费图片">
                        <span class="spanToInput">{{list.refereeName | filterNull}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="前后图片">
                        <span class="spanToInput">{{list.referee | filterNull}}</span>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>
    </div>
</template>
<script>
    import { detailProject } from '@/api/subsidyManage'
    export default {
        name:"subsidyManageInfo",
        data(){
            return {
                val:"1",
                userId:"",
                dialogResults:false,
                list:{},
                tableData: [{
                    date: '2016-05-02',
                    name: '王小虎'
                }],
            }
        },
        filters:{
            filterNull(e) {
                if(!e){
                    return "暂无"
                }else{
                    return e
                }
            },
            cardNull(e){
                return window.helper.cardType(e)
            },
            userFocus(e){
                return window.helper.userFocus(e)
            }
        },
        mounted(){
            this.userId = String(this.$route.query.userId)
            this.getList()
        },
        methods:{
            getList(){
                let datas = {id:this.userId}
                detailProject(datas).then().then(res =>{
                    console.log(res)
                    if(!res.data.code){
                        this.list = res.data.data
                        this.tableData = res.data.data.data.achievements
                    }else{
                        this.$message.error("数据接口访问失败");
                    }
                })
                .catch(error =>{
                    this.$message.error(error);
                })
            }
        }
    }
</script>

<style scoped>
    .app-container{padding: 0px!important}
    .form{margin-left: 268px}
</style>